package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.*;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.DetailQueryListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.FansBranchQueryListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.FundFrozenForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.operate.OperateFundT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

@Controller
public class FundBranchController {
    
    @Resource
    private OperateFundT2BizService fundT2BizService;
    
    /**
     * 管理中台粉丝资金列表
     */
    @ResponseBody
    @RequestMapping("/func_fans_fund_list")
    @SaveLog(remark = "管理中台粉丝资金列表")
    public FansFundListResult funcFansFundList(HttpServletRequest request, String jsonpcallback) {
        FansBranchQueryListForm form = getSingleParameterMapForBody(request, FansBranchQueryListForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcFansFundList(form), jsonpcallback);
    }

    /**
     * 管理中台投顾资金列表
     */
    @ResponseBody
    @RequestMapping("/func_broker_fund_list")
    @SaveLog(remark = "管理中台投顾资金列表")
    public BrokerFundListResult funcBrokerFundList(HttpServletRequest request, String jsonpcallback) {
        FansBranchQueryListForm form = getSingleParameterMapForBody(request, FansBranchQueryListForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcBrokerFundList(form), jsonpcallback);
    }

    /**
     * 管理中台粉丝消费列表
     */
    @ResponseBody
    @RequestMapping("/func_fans_consume_list")
    @SaveLog(remark = "管理中台粉丝消费列表")
    public FansConsumeListResult funcFansConsumeList(HttpServletRequest request, String jsonpcallback) {
        DetailQueryListForm form = getSingleParameterMapForBody(request, DetailQueryListForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcFansConsumeList(form), jsonpcallback);
    }

    /**
     * 管理中台粉丝充值列表
     */
    @ResponseBody
    @RequestMapping("/func_fans_charge_list")
    @SaveLog(remark = "管理中台粉丝充值列表")
    public FansChargeListResult funcFansChargeList(HttpServletRequest request, String jsonpcallback) {
        DetailQueryListForm form = getSingleParameterMapForBody(request, DetailQueryListForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcFansChargeList(form), jsonpcallback);
    }

    /**
     * 管理中台投顾收入列表
     */
    @ResponseBody
    @RequestMapping("/func_broker_income_list")
    @SaveLog(remark = "管理中台投顾收入列表")
    public BrokerIncomeListResult funcBrokerIncomeList(HttpServletRequest request, String jsonpcallback) {
        DetailQueryListForm form = getSingleParameterMapForBody(request, DetailQueryListForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcBrokerIncomeList(form), jsonpcallback);
    }

    /**
     * 管理中台粉丝资金冻结
     */
    @ResponseBody
    @RequestMapping("/func_fans_fund_frozen")
    @SaveLog(remark = "管理中台粉丝资金冻结")
    public HSBCPSBackVO funcFansFundFrozen(HttpServletRequest request, String jsonpcallback) {
        FundFrozenForm form = getSingleParameterMapForBody(request, FundFrozenForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcFansFundFrozen(form), jsonpcallback);
    }

    /**
     * 管理中台粉丝资金冻结
     */
    @ResponseBody
    @RequestMapping("/func_broker_fund_frozen")
    @SaveLog(remark = "管理中台投顾资金冻结")
    public HSBCPSBackVO funcBrokerFundFrozen(HttpServletRequest request, String jsonpcallback) {
        FundFrozenForm form = getSingleParameterMapForBody(request, FundFrozenForm.class);
        return VOUtil.setJsonpResult(fundT2BizService.funcBrokerFundFrozen(form), jsonpcallback);
    }

}
